

#include "StdAfx.h"
#include "CObjectFactory.h"
#include "CDelayedDeleteListener.h"

// constructor for the listener class
CDelayedDeleteListener::CDelayedDeleteListener(CObjectFactory *parent)
{
	m_Parent = parent;
}

// function called when the listener is initialized from
// the system listener
bool CDelayedDeleteListener::Init(void)
{
	return true;
}

// Update function called from the system listener
void CDelayedDeleteListener::Update(DWORD tickCount)
{
	m_Parent->DeleteDelayedObjects();
}

// call from system listener to shutdown
bool CDelayedDeleteListener::DeInit(void)
{
	return true;
}

// returns name of manager type
IHashString* CDelayedDeleteListener::GetName()
{
	if (m_Parent)
	{
		return m_Parent->GetComponentType();
	}
	else
	{
		return NULL;	
	}
}